import request from '@/utils/request';

/**
 * 查询资产类别列表
 * @param query
 * @returns {*}
 */

export const listAssetCategory = (query?: any) => {
  return request({
    url: '/business/category/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询资产类别详细
 * @param id
 */
export const getAssetCategory = (id: string | number) => {
  return request({
    url: '/business/category/' + id,
    method: 'get'
  });
};

/**
 * 新增资产类别
 * @param data
 */
export const addAssetCategory = (data: any) => {
  return request({
    url: '/business/category',
    method: 'post',
    data: data
  });
};

/**
 * 修改资产类别
 * @param data
 */
export const updateAssetCategory = (data: any) => {
  return request({
    url: '/business/category',
    method: 'put',
    data: data
  });
};

/**
 * 删除资产类别
 * @param id
 */
export const delAssetCategory = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/category/' + id,
    method: 'delete'
  });
};
